<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>margin负值的应用</title>

    <style>
        ul li {
            position: relative;
            float: left;
            margin-left: -1px;
            width: 150px;
            height: 200px;
            list-style: none;
            border: 1px solid red;
        }

        /* 当盒子没有定位，则鼠标经过添加相对定位即可 */
        /* ul li:hover {
            position: relative;
            border: 1px solid black;
        } */

        /* 当盒子有定位，则鼠标经过提高层级 */
        ul li:hover {
            z-index: 10;
            border: 1px solid black;
        }
    </style>
    
</head>
<body>
    <h3>如果盒子都有1px边框在边框重叠部分就会产生2px的边框，所以使用margin-left：-1px</h3>
    <ul>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>
    </ul>

</body>
</html>